package deepseek_api

import (
	"context"

	"github.com/go-deepseek/deepseek"
	"github.com/go-deepseek/deepseek/request"
)

const apiKey = "sk-0a8f5208bf1b49ab9dca0de1452eb426"

func NewClient() (deepseek.Client, error) {
	client, err := deepseek.NewClient(apiKey)
	return client, err
}

func SendMessage(ctx context.Context, cli deepseek.Client, req *request.ChatCompletionsRequest) (result string, err error) {
	resp, err := cli.CallChatCompletionsChat(ctx, req)
	if err != nil {
		return result, err
	}
	return resp.Choices[0].Message.Content, nil
}
